<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8" />
  <link href="/static/css/register.css" rel="stylesheet" type="text/css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <title>用户注册</title>
  <script type="text/javascript">
   alert("联系我获得卡密,QQ582946945");
    $(function(){
     $("#loginbtn").click(function(){
     var username = $("#inp1").val();
     var pwd = $("#inp2").val();
     var kh = $("#inp3").val();
     if(username!="" && pwd!="" && kh!=""){
        $.post("/registers",{"username":username,"pwd":pwd,"kahao":kh},function(data){
        if (data["state"] == "success"){
            alert("注册成功");
        }else if(data["state"] == "fail" && data["code"]==0){
            alert("卡号有误!");
            window.location.reload();
        }else{
            alert("账号已经存在!");
            window.location.reload();
        }
        })
     }else{
        alert("别使坏哦!");
     }
     });
     })

    </script>
 </head>
 <body bgcolor="#D2B48C">
  <div class="nav">
   <div class="logo">
    <a class="gs" href="/"> <img id="sg1" src="/static/img/login_logo.png" /> </a>
    <img id="title" src="/static/img/title.png" />
    <a class="gs" href="/"> <img id="sg2" src="/static/img/login_logo.png" /> </a>
   </div>
  </div>
  <div class="nav2">
   <div class="sucai">
    <img src="/static/img/sucai1.png" style="position:absolute;left:50px;" />
    <img src="/static/img/sucai2.png" style="position:absolute;right:50px;" />
   </div>
   <div class="inner">
    <center>
     <h2>用户注册</h2>
    </center>
    <div id="container">
     <div id="user">
      <input id="inp1" type="text" name="user" placeholder="请输入账号" />
     </div>
     <div id="pwd">
      <input id="inp2" type="password" name="pwd" placeholder="请输入密码" />
     </div>
     <div id="number">
      <input id="inp3" type="password" name="kahao" placeholder="请输入卡密" />
     </div>
    </div>
    <button id="loginbtn" type="submit">注册</button>
    <button id="loginbtn1" type="submit" onclick="javascript:window.history.back();">返回</button>
   </div>
   <div class="crawl">
    <img src="/static/img/crawl1.png" id="crawl1" style="position:absolute;right:250px;bottom:100px;" />
   </div>
  </div>
  <div class="nav3">
   <div class="zhuangshi">
    <img src="/static/img/zhuangshi.png" class="sanhuan" style="width:10%; height:auto;float:left" />
    <img src="/static/img/zhuangshi2.png" class="sanhuan" style="width:10%; height:auto;float:right" />
   </div>
   <center>
    <span style="color:white;">免责声明:</span>
   </center>
   <center>
    <span style="color:white;">此网站为个人纯粹的开发训练项目,用到的图片素材均为网上素材</span>
   </center>
   <center>
    <span style="color:white;">若存在侵权行为,请联系我删除。特此声明!</span>
   </center>
   <center>
    <span style="color:white;">联系方式:QQ582946945</span>
   </center>
  </div>
 </body>
</html>